var mongoose = require('mongoose');
const {dbUrl}=require('../config/config.default')
mongoose.connect(dbUrl);

var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function() {
  console.log('链接成功');
});
// const Cat = mongoose.model('Cat', { name: String });

// const kitty = new Cat({ name: 'Zildjian' });
// kitty.save().then(() => console.log('meow'));
module.exports={
    User:mongoose.model('User',require('./user')),
    Article:mongoose.model('Article',require('./article'))
}